<?php
	ob_start();
	session_start();

	function __autoload($class_name) {
		include './'.$class_name . '.php';
	}
	$results = array();
	$productId = $_GET['productId'];
	$cart = $_SESSION['cart'];
	$status = false;
	
	if(is_null($cart)){
		$results['status'] = -1;		
	}else{
		$cart->removeOrder($productId);
		$results['status'] = 1;
		$status = true;
	}
	
	if($status){
		header("Location: shoppingcart.php");
	}
	$results['#success'] = $status;
	echo json_encode($results);
	ob_end_flush();
?>
